Optimal. Leaf size=116 \[ -\frac{i \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\frac{4 a^4 \tan (c+d x)}{d}+\frac{8 i a^4 \log (\cos (c+d x))}{d}-8 a^4 x-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\frac{i a (a+i a \tan (c+d x))^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.091607, antiderivative size = 116, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3543, 3478, 3477, 3475} \[ -\frac{i \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\frac{4 a^4 \tan (c+d x)}{d}+\frac{8 i a^4 \log (\cos (c+d x))}{d}-8 a^4 x-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\frac{i a (a+i a \tan (c+d x))^3}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3543
Rule 3478
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int \tan ^2(c+d x) (a+i a \tan (c+d x))^4 \, dx &=-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\int (a+i a \tan (c+d x))^4 \, dx\\ &=-\frac{i a (a+i a \tan (c+d x))^3}{3 d}-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-(2 a) \int (a+i a \tan (c+d x))^3 \, dx\\ &=-\frac{i a (a+i a \tan (c+d x))^3}{3 d}-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\frac{i \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\left (4 a^2\right ) \int (a+i a \tan (c+d x))^2 \, dx\\ &=-8 a^4 x+\frac{4 a^4 \tan (c+d x)}{d}-\frac{i a (a+i a \tan (c+d x))^3}{3 d}-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\frac{i \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\left (8 i a^4\right ) \int \tan (c+d x) \, dx\\ &=-8 a^4 x+\frac{8 i a^4 \log (\cos (c+d x))}{d}+\frac{4 a^4 \tan (c+d x)}{d}-\frac{i a (a+i a \tan (c+d x))^3}{3 d}-\frac{i (a+i a \tan (c+d x))^5}{5 a d}-\frac{i \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}\\ \end{align*}
Mathematica [B] time = 2.76358, size = 294, normalized size = 2.53 \[ -\frac{a^4 \sec (c) \sec ^5(c+d x) \left (345 \sin (2 c+d x)-275 \sin (2 c+3 d x)+120 \sin (4 c+3 d x)-79 \sin (4 c+5 d x)+150 d x \cos (2 c+3 d x)-90 i \cos (2 c+3 d x)+150 d x \cos (4 c+3 d x)-90 i \cos (4 c+3 d x)+30 d x \cos (4 c+5 d x)+30 d x \cos (6 c+5 d x)-75 i \cos (2 c+3 d x) \log \left (\cos ^2(c+d x)\right )+30 \cos (d x) \left (-5 i \log \left (\cos ^2(c+d x)\right )+10 d x-7 i\right )+30 \cos (2 c+d x) \left (-5 i \log \left (\cos ^2(c+d x)\right )+10 d x-7 i\right )-75 i \cos (4 c+3 d x) \log \left (\cos ^2(c+d x)\right )-15 i \cos (4 c+5 d x) \log \left (\cos ^2(c+d x)\right )-15 i \cos (6 c+5 d x) \log \left (\cos ^2(c+d x)\right )-445 \sin (d x)\right )}{120 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 117, normalized size = 1. \begin{align*} 8\,{\frac{{a}^{4}\tan \left ( dx+c \right ) }{d}}+{\frac{{a}^{4} \left ( \tan \left ( dx+c \right ) \right ) ^{5}}{5\,d}}-{\frac{i{a}^{4} \left ( \tan \left ( dx+c \right ) \right ) ^{4}}{d}}-{\frac{7\,{a}^{4} \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{3\,d}}+{\frac{4\,i{a}^{4} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}-{\frac{4\,i{a}^{4}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{d}}-8\,{\frac{{a}^{4}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.65672, size = 128, normalized size = 1.1 \begin{align*} \frac{3 \, a^{4} \tan \left (d x + c\right )^{5} - 15 i \, a^{4} \tan \left (d x + c\right )^{4} - 35 \, a^{4} \tan \left (d x + c\right )^{3} + 60 i \, a^{4} \tan \left (d x + c\right )^{2} - 120 \,{\left (d x + c\right )} a^{4} - 60 i \, a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 120 \, a^{4} \tan \left (d x + c\right )}{15 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.24581, size = 664, normalized size = 5.72 \begin{align*} \frac{840 i \, a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 2220 i \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 2620 i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 1460 i \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 316 i \, a^{4} +{\left (120 i \, a^{4} e^{\left (10 i \, d x + 10 i \, c\right )} + 600 i \, a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 1200 i \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 1200 i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 600 i \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 120 i \, a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{15 \,{\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 7.76811, size = 226, normalized size = 1.95 \begin{align*} \frac{8 i a^{4} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac{\frac{56 i a^{4} e^{- 2 i c} e^{8 i d x}}{d} + \frac{148 i a^{4} e^{- 4 i c} e^{6 i d x}}{d} + \frac{524 i a^{4} e^{- 6 i c} e^{4 i d x}}{3 d} + \frac{292 i a^{4} e^{- 8 i c} e^{2 i d x}}{3 d} + \frac{316 i a^{4} e^{- 10 i c}}{15 d}}{e^{10 i d x} + 5 e^{- 2 i c} e^{8 i d x} + 10 e^{- 4 i c} e^{6 i d x} + 10 e^{- 6 i c} e^{4 i d x} + 5 e^{- 8 i c} e^{2 i d x} + e^{- 10 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.69824, size = 370, normalized size = 3.19 \begin{align*} \frac{120 i \, a^{4} e^{\left (10 i \, d x + 10 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 i \, a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 1200 i \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 1200 i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 i \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 840 i \, a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 2220 i \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 2620 i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 1460 i \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 120 i \, a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 316 i \, a^{4}}{15 \,{\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]